﻿--
--
IF EXISTS (SELECT name FROM sysobjects WHERE name = 'spZeusPickingClose' AND type = 'P')
BEGIN
  DROP PROCEDURE spZeusPickingClose
END
GO

-- HU - Kiszedési lista lezárása
-- EN - Close picking list
--
CREATE PROCEDURE spZeusPickingClose
(@AccessToken INTEGER, @ID NVARCHAR(20))
 AS
BEGIN
  DECLARE
    @Err INTEGER,
    @Rows INTEGER,
    @UserID INTEGER,
    @Lang NVARCHAR(10)

  EXEC @Err = spAccessTokenCheck @AccessToken, @UserID OUTPUT, @Lang OUTPUT

  IF (@Err != 0)
    GOTO __ERROR__

  -- HU - Lezárjuk a kiszedési listát
  -- EN - Close picking list    
  BEGIN TRY

    UPDATE ZeusPicking
       SET Status = 'C'
     WHERE ID = @ID

  END TRY
  BEGIN CATCH

  END CATCH
    

-- Well done.
--
  RETURN(0)

-- We have a problem !
--
__ERROR__:
  RETURN(1)
END
GO
